<?php
/**
 * 美剧基类
 * americancontroll.php
 * Create on 2016-03-29 14:57:31
 * Create by yuebin
 */
namespace haibao\cms\business\control;

use haibao\cms\model\filter\americandrama\AmericanPlayWeek as AmericanPlayWeekFilter;
use haibao\cms\model\filter\americandrama\AmericanDefine as AmericanDefineFilter;
use haibao\cms\model\filter\americandrama\AmericanCategory as AmericanCategoryFilter;
use haibao\cms\model\filter\americandrama\AmericanRadio as AmericanRadioFilter;
use haibao\cms\model\data\americandrama\AmericanDefine as AmericanDefineModel;
use haibao\frame\data\query\Condition;
use haibao\frame\data\exception\DataErrorException;
use haibao\frame\http\UserControl;
use haibao\frame\data\query\Pager;

class AmericanController extends \haibao\cms\business\control\pc\channel\ChannelController{
	
    const PAGE_SIZE = 20;
    const WAP_PAGE_SIZE = 10;
    const PC_PAGE_SIZE = 20;
    const AMERICAN_A_Z_OTHER_LETTER = 'OTHER';
	const AMERICAN_TOP_TAG_ID = 11280;
	const TV_CHANNEL = 'tv';
	const NEWSUPDATE = 1;
	const TOPTEN = 2;
	const HOTSTAR = 3;
	const PRO_FIVE = 5;//文章4：3
	const PRO_FOUR = 4;//文章1：1
	const PRO_TWO = 2;//图集4：3
	const PRO_ONE = 1;//图集1：1
	const PRO_ZERO = 0;//默认
    private static $_instance;
    public static $videoArticleTag = array(11311,11312);
    public static $cateInfo = array(
        '美剧追踪'=>11281,
        '剧星动态'=>11341,
        '剧评影评'=>11282,
        '片花视频'=>11283,
        '红毯颁奖'=>11284
    );
    public $americanData;
    public $baseUrl = '';
	public function __construct($updateTime='',$controlId='',$isPublish=''){
		parent::__construct($updateTime,$controlId,$isPublish);
	}

	public static function getAmericanInstance(){
	    if(!(self::$_instance instanceof self)){
	        self::$_instance = new self;
	    }
	    return self::$_instance;
	}
	
	public function displayTemplateHtml(){
	    $controlData = $this->getParameter(self::$CONTROL_DATA);
	    $content = $this->getParameter(self::$CONTROL_CONTENT);
	    $path = $this->generateHtmlPath(__CLASS__);
	    $isNewHtml = $this->generateHtml($path,$content);
	    $content = $this->getHtml($path);
	    $content = $this->replaceCDNLink($content);
	    return $content;
	}
	
	public static function getAmericanSearchUrl($type = 0,$station = 0,$date = 0,$letter = 0,$isPc = true){
	    
		return array(
				'WAP'=>\haibao\classlibrary\cms\Config::getConfig(\haibao\classlibrary\cms\Config::CLASSLIBRARY_CONFIG_HOST_WAP).'/tv/ku/list_'.$type.'_'.$station.'_'.$date.'_'.$letter.'_0_0/',
				'PC' =>\haibao\classlibrary\cms\Config::getConfig(\haibao\classlibrary\cms\Config::CLASSLIBRARY_CONFIG_TV_HOST).'ku/list_'.$type.'_'.$station.'_'.$date.'_'.$letter.'_0_0/',
		);
	    
	}
	
	//周播表
	public function getWeekInfo(){
	    $americanPlayWeekFilter = new AmericanPlayWeekFilter();
	    $americanPlayWeekFilter->select(array(
	        AmericanPlayWeekFilter::CONDITION_FIELD_NAME_AMERICAN_ID,
	        AmericanPlayWeekFilter::CONDITION_FIELD_NAME_PLAYDATE,
	        AmericanPlayWeekFilter::CONDITION_FIELD_NAME_PLAYEPISODE,
	        AmericanPlayWeekFilter::CONDITION_FIELD_NAME_AMERICAN_NAMECH,
	        AmericanPlayWeekFilter::CONDITION_FIELD_NAME_AMERICAN_NAMEEN
	    ));
	    
	    $americanDefineFilter = new AmericanDefineFilter();
	    $americanDefineFilter->select(array(
	        AmericanDefineFilter::CONDITION_FIELD_NAME_ID,
	        AmericanDefineFilter::CONDITION_FIELD_NAME_AVATARURL,
	        AmericanDefineFilter::CONDITION_FIELD_NAME_NAMECN,
	        AmericanDefineFilter::CONDITION_FIELD_NAME_NAMEEN
	    ));
	    
	    $sdefaultDate = date("Y-m-d");
	    $first=1;
	    $w=date('w',strtotime($sdefaultDate));
	    $week_start=date('Y-m-d',strtotime("$sdefaultDate -".($w ? $w - $first : 6).' days'));
	    $week_end=date('Y-m-d',strtotime("$week_start +6 days"));
	    $americanDefineFilter->where($americanDefineFilter::CONDITION_FIELD_NAME_STATUS, Condition::CONDITION_EQUAL, \haibao\cms\model\data\americandrama\AmericanDefine::STATUS_ENABLE);
	    $americanPlayWeekFilter->leftJoin($americanDefineFilter,null,$americanPlayWeekFilter::CONDITION_FIELD_NAME_AMERICAN_ID,$americanDefineFilter::CONDITION_FIELD_NAME_ID,$americanPlayWeekFilter::CONDITION_FIELD_NAME_AMERICAN_DRAMANAME,false);
	    $americanPlayWeekFilter->order($americanPlayWeekFilter::CONDITION_FIELD_NAME_PLAYDATE,false);
	    $americanPlayWeekFilter->where($americanPlayWeekFilter::CONDITION_FIELD_NAME_PLAYDATE, Condition::CONDITION_GREATEREQUAL, $week_start);
	    $americanPlayWeekFilter->where($americanPlayWeekFilter::CONDITION_FIELD_NAME_PLAYDATE, Condition::CONDITION_LESS, $week_end);
	    $weekInfo = \haibao\cms\business\americandrama\AmericanDefine::getAmericanWeekPlay($americanPlayWeekFilter);
	    $autoInfo = $weekDetailInfo = $weekNewInfo = array();
	    $autoInfo = \haibao\cms\business\americandrama\AmericanDefine::getWeekPlayAutoData();
	    foreach($weekInfo as $key=>$val){
	        $weekDetailInfo['AmericanId'] = $val->AmericanId;
	        $weekDetailInfo['AmericanNameCH'] = $val->AmericanDramaName->AmericanNameCH;
	        $weekDetailInfo['AmericanNameEN'] = $val->AmericanDramaName->AmericanNameEN;
	        $weekDetailInfo['PlayEpisode'] = $val->PlayEpisode;
	        $weekDetailInfo['PlayDate'] = $val->PlayDate->format('Y-m-d');
	        $weekDetailInfo['AvatarUrl'] = self::getImageLink($val->AmericanDramaName->AvatarUrl,110,146,100);
	        $weekDetailInfo['NameCH'] = $val->AmericanDramaName->NameCH;
	        $weekDetailInfo['NameEN'] = $val->AmericanDramaName->NameEN;
	        $weekDetailInfo['Url'] = \haibao\classlibrary\cms\Config::getConfig(\haibao\classlibrary\cms\Config::CLASSLIBRARY_CONFIG_TV_HOST).'meiju/'.$val->AmericanId.'/';
	        array_push($weekNewInfo,$weekDetailInfo);
	    }
	    $newWeekNewInfo = array_merge($weekNewInfo,$autoInfo);
	    
	    $sdefaultDate = date("Y-m-d");
	    $week = $this->riqi($sdefaultDate);
	    $dateKeyInfo= array_flip($week);
	    foreach($dateKeyInfo as $key=>$val){
	        $dateKeyInfo[$key] = array();
	    }
	    foreach($dateKeyInfo as $key=>$val){
	        foreach($newWeekNewInfo as $k=>$v){
	            if($v['PlayDate'] == $key){
	                $dateKeyInfo[$key][] = $v;
	            }
	        }
	    }
	    foreach($dateKeyInfo as $i=>$val){
	        $key = $i.'&nbsp;'.date("D",strtotime($i));
	        $dateKeyInfo[$key] = $val;
	        unset($dateKeyInfo[$i]);
	    }
	    return $dateKeyInfo;
	}
    
	public function riqi($week){
	    $whichD=date('w',strtotime($week));
	    $weeks=array();
	    for($i=1;$i<=7;$i++){
	        if($i<$whichD){
	            $date=strtotime($week)-($whichD-$i)*24*3600;
	        }else{
	            $date=strtotime($week)+($i-$whichD)*24*3600;
	        }
	        $weeks[$i]=date('Y-m-d',$date);
	    }
	    return $weeks;
	}

	//取文章 图集 合并数据
	public function getArticleInfo($dataType){
	    $dataCondition['source'] = __CLASS__;
	    $dataCondition['level'] = 3;
	    $dataCondition['isProImage'] = true;
	    $dataCondition['isPrimaryTag'] = false;
	    $dataCondition['isParentTag'] = true;
	    $dataCondition['isReturnTag'] = true;
	    $dataCondition['isTag'] = true;
	    $dataCondition['isConditionTag'] = true;
	    $parentId = self::AMERICAN_TOP_TAG_ID;
	    $articles = $imageColls = array();
	    if($dataType == self::NEWSUPDATE){
	        //美剧追踪
	        $this->conditionTagId = 11281;
	        $dataCondition['isParentTag'] = false;
	        $dataCondition['isReturnPrimary'] = false;
	        $dataCondition['limit'] = 8;
	        $dataCondition['proImageLevel'] = array(\haibao\cms\model\data\ArticleProImage::Level_FIVE);
	        list($articles,$imageColls) = $this->getArticleControl(1,$dataCondition);
	    }elseif($dataType == self::TOPTEN){
	        //报友最爱看top10
	        $this->conditionTagId = self::AMERICAN_TOP_TAG_ID;
	        $dataCondition['limit'] = 10;
	        $dataCondition['isDate'] = true;
	        $dataCondition['dateType'] = 2;
	        $dataCondition['proImageLevel'] = array(\haibao\cms\model\data\ArticleProImage::Level_FOUR);
	        list($articles,$imageColls) = $this->getArticleControl(2,$dataCondition);
	    }else{
	        //当红剧星 文章
	        $this->conditionTagId = 11341;
	        $dataCondition['limit'] = 15;
	        $dataCondition['isDate'] = true;
	        $dataCondition['dateType'] = 3;
	        $dataCondition['isParentTag'] = false;
	        $dataCondition['isReturnPrimary'] = false;
	        $dataCondition['proImageLevel'] = array(\haibao\cms\model\data\ArticleProImage::Level_FOUR);
	        list($articles,$imageColls) = $this->getArticleControl(1,$dataCondition);
	    }

	    $mergeData = array();
	    if(!empty($articles['list']) || !empty($imageColls['list'])){
	        $mergeData = $this->mergeData($articles['list'],$imageColls['list'],$dataCondition['limit']);
	    }
	    
	    $articleTagArr = array();
	    if(isset($articles['articleTag']) && !empty($articles['articleTag'])){
	        foreach($articles['articleTag'] as $key=>$val){
	            foreach($val as $k=>$v){
	                $articleTagArr[$key][] = $v['TagId'];
	            }
	        }
	    }
	    $imageCollTagArr = array();
	    if(isset($imageColls['collTag']) && !empty($imageColls['collTag'])){
	        foreach($imageColls['collTag'] as $key=>$val){
	            foreach($val as $k=>$v){
	                $imageCollTagArr[$key][] = $v['TagId'];
	            }
	        }
	    }
	    $topTag = self::getTopTags();
	    foreach($mergeData as $key=>$article){
	        if($article->SiteType == ArticleController::INFO_TYPE_ARTICLE){
	            if($dataType == self::NEWSUPDATE){
                    if(isset($articles['proImage'][$article->Id][self::PRO_FIVE])){
                        $article->AccessUrl = $articles['proImage'][$article->Id][self::PRO_FIVE];
                    }else{
                        $article->AccessUrl = $articles['proImage'][$article->Id][self::PRO_ZERO];
                    }
                }else{
                    if(isset($articles['proImage'][$article->Id][self::PRO_FOUR])){
                        $article->AccessUrl = $articles['proImage'][$article->Id][self::PRO_FOUR];
                    }else {
                        $article->AccessUrl = $articles['proImage'][$article->Id][self::PRO_ZERO];  //图片地址
                    }
                }
                
	            $article->ArticleUrl = $this->getArticleUrl($article->PublishId,$parentId); //文章地址
	             
	            if(isset($articles['articleTag'][$article->Id])){
	                foreach($articles['articleTag'][$article->Id] as $m=>$primary){
	                    if($primary['IsPrimaiy'] == 1){
	                       $article->ArticleTag->TagId = $primary['TagId'];
	                       $article->ArticleTag->IsPrimaiy = 1;
	                       $article->ArticleTag->ParentId = $primary['ParentId'];
	                    }
	                }
	            }
	            if(isset($articles['tag'][$article->ArticleTag->TagId])){
	                $article->ArticleTag->TagName = $articles['tag'][$article->ArticleTag->TagId]['TagName'];
	                $article->ArticleTag->TagUrl = $articles['tag'][$article->ArticleTag->TagId]['Url']; //tagURl
	            }
	             
	            if(!empty($articleTagArr) && isset($articleTagArr[$article->Id])){
	                $article->ArticleTag->ArticleRel = $articleTagArr[$article->Id];
	            }
	        }elseif($article->SiteType == ArticleController::INFO_TYPE_IMAGE){
	            if(isset($imageColls['proImage'][$article->Id])){
	                if($dataType == self::NEWSUPDATE){
	                    if(isset($imageColls['proImage'][$article->Id][self::PRO_TWO])){
	                        $article->AccessUrl = $imageColls['proImage'][$article->Id][self::PRO_TWO];
	                    }else {
	                        $article->AccessUrl = $imageColls['proImage'][$article->Id][self::PRO_ZERO]; //图片地址
	                    }
	                }else{
	                    if(isset($imageColls['proImage'][$article->Id][self::PRO_ONE])){
	                        $article->AccessUrl = $imageColls['proImage'][$article->Id][self::PRO_ONE];
	                    }else {
	                        $article->AccessUrl = $imageColls['proImage'][$article->Id][self::PRO_ZERO]; //图片地址
	                    }
	                }
	            
	            }
	            $article->ImageCollectivePro = \haibao\classlibrary\Config::getConfig(\haibao\classlibrary\Config::CLASSLIBRARY_CONFIG_HOST_PIC).'/'.$topTag[$parentId]['channel'].'/pics/'.$article->ImageCollectiveTag->ImageCollectiveId.'.htm';
	             
	            if(isset($imageColls['collTag'][$article->Id])){
	                foreach($imageColls['collTag'][$article->Id] as $m=>$primary){
	                    if($primary['IsPrimaiy'] == 1){
	                        $article->ImageCollectiveTag->TagId = $primary['TagId'];
	                        $article->ImageCollectiveTag->IsPrimaiy = 1;
	                        $article->ImageCollectiveTag->ParentId = $primary['ParentId'];
	                    }
	                }
	            }
	            if(isset($imageColls['tag'][$article->ImageCollectiveTag->TagId])){
	                $article->ImageCollectiveTag->TagName = $imageColls['tag'][$article->ImageCollectiveTag->TagId]['TagName'];
	                $article->ImageCollectiveTag->Url = $imageColls['tag'][$article->ImageCollectiveTag->TagId]['Url'];
	            }
	            if(!empty($imageCollTagArr) && isset($imageCollTagArr[$article->Id])){
	                $article->ImageCollectiveTag->ImageCollRel = $imageCollTagArr[$article->Id];
	            }
	        }
	        
	    }

        if($dataType == self::HOTSTAR){
            return array($articles,$imageColls);
        }
	    return $mergeData;
	}
	
	//检索页  封装查询
	/**
	 * @param Array $condition 查询条件
	 * @return Object $americanList 美剧列表
	 * $isWap来源是否为WAP,true为WAP，pc为false
	 */
	public function getAmericanList($condition,$isGetAll = true,$isWap = false){
	    // 根据$confition 封装query filter
	    
	    $dataList = $this->getAmericanListByCondition($condition,$isWap);
	    
	    return $dataList;
	}
	

	
	public function getAmericanListByCondition($condition,$isWap){
	    $americanFilter = new AmericanDefineFilter();
	    $americanFilter->select(array(
	        AmericanDefineFilter::CONDITION_FIELD_NAME_ID,
	        AmericanDefineFilter::CONDITION_FIELD_NAME_NAMECN,
	        AmericanDefineFilter::CONDITION_FIELD_NAME_NAMEEN,
	        AmericanDefineFilter::CONDITION_FIELD_NAME_AVATARURL,
	        AmericanDefineFilter::CONDITION_FIELD_NAME_PINYINEN,
	        AmericanDefineFilter::CONDITION_FIELD_NAME_RELEASEDATE,
	    ))->limit(0,20);
	    
	    
	    $americanCategoryFilter = new AmericanCategoryFilter();
	    $americanCategoryFilter->select(array(
	        AmericanCategoryFilter::CONDITION_FIELD_NAME_ID,
	        AmericanCategoryFilter::CONDITION_FIELD_NAME_AMERICANID,
	        AmericanCategoryFilter::CONDITION_FIELD_NAME_CATEGORYID
	    ));
	    $americanFilter->leftJoin($americanCategoryFilter,null,$americanFilter::CONDITION_FIELD_NAME_ID,$americanCategoryFilter::CONDITION_FIELD_NAME_AMERICANID,$americanFilter::CONDITION_FIELD_NAME_AMERICANCATEGORY);
	     
	    //剧目类型
	    if($condition['type']){
	        $americanCategoryFilter = new AmericanCategoryFilter();
	        $americanCategoryFilter->select(array(
    	        AmericanCategoryFilter::CONDITION_FIELD_NAME_ID,
    	        AmericanCategoryFilter::CONDITION_FIELD_NAME_AMERICANID,
    	    ));
	        $americanFilter->leftjoin($americanCategoryFilter, null, $americanFilter::CONDITION_FIELD_NAME_ID, $americanCategoryFilter::CONDITION_FIELD_NAME_AMERICANID, $americanFilter::CONDITION_FIELD_NAME_AMERICANCATEGORY);
	        $americanCategoryFilter->where(AmericanCategoryFilter::CONDITION_FIELD_NAME_CATEGORYID, Condition::CONDITION_EQUAL, (int)$condition['type']);
	    }
	
	    //电视台
	    if($condition['station']){
	        $americanRadioFilter = new AmericanRadioFilter();
	        $americanRadioFilter->select(array(
	            AmericanRadioFilter::CONDITION_FIELD_NAME_ID,
	            AmericanRadioFilter::CONDITION_FIELD_NAME_AMERICANID,
	            AmericanRadioFilter::CONDITION_FIELD_NAME_RADIOID
	        ));
	        $americanFilter->leftjoin($americanRadioFilter, null, $americanFilter::CONDITION_FIELD_NAME_ID, $americanRadioFilter::CONDITION_FIELD_NAME_AMERICANID, $americanFilter::CONDITION_FIELD_NAME_AMERICANRADIO);
	        $americanRadioFilter->where(AmericanRadioFilter::CONDITION_FIELD_NAME_RADIOID, Condition::CONDITION_EQUAL, (int)$condition['station']);
	    }
	   
	    $showDateArr = \haibao\cms\business\americandrama\AmericanDefine::$meiju_date_arr;
	   
	   //上映日期
	    foreach($showDateArr as $key=>$val){
	        if($val == '2006'){
	            $position = $key;
	        }
	    }
	    
	    if($condition['date']){
	        if($condition['reserve'] == 1 && $condition['date'] == $position){
	            $americanFilter->where(AmericanDefineFilter::CONDITION_FIELD_NAME_RELEASEDATE,Condition::CONDITION_BETWEEN,array(date('2000-01-01'),date('2006-12-31')));
	        }else{
	            if($showDateArr[$condition['date']] == '90年代'){
	                $americanFilter->where(AmericanDefineFilter::CONDITION_FIELD_NAME_RELEASEDATE,Condition::CONDITION_BETWEEN,array(date('1990-01-01'),date('1999-12-31')));
	            }elseif($showDateArr[$condition['date']] == '80年代'){
	                $americanFilter->where(AmericanDefineFilter::CONDITION_FIELD_NAME_RELEASEDATE,Condition::CONDITION_BETWEEN,array(date('1980-01-01'),date('1989-12-31')));
	            }elseif($showDateArr[$condition['date']] == '70年代'){
	                $americanFilter->where(AmericanDefineFilter::CONDITION_FIELD_NAME_RELEASEDATE,Condition::CONDITION_BETWEEN,array(date('1970-01-01'),date('1979-12-31')));
	            }elseif($showDateArr[$condition['date']] == '60年代'){
	                $americanFilter->where(AmericanDefineFilter::CONDITION_FIELD_NAME_RELEASEDATE,Condition::CONDITION_BETWEEN,array(date('1960-01-01'),date('1969-12-31')));
	            }else{
	                $americanFilter->where(AmericanDefineFilter::CONDITION_FIELD_NAME_RELEASEDATE,Condition::CONDITION_LIKE,'%'. $showDateArr[$condition['date']] .'%');
	            }
	        }
	        
	    }
	    
	    
	    if($condition['letter']){
	        if($condition['letter'] === self::AMERICAN_A_Z_OTHER_LETTER){
	            $enRange = array();
	            for($i=ord('A');$i<=ord('Z');$i++){
	                array_push($enRange,chr($i));
	            }
	            //$americanFilter->where(AmericanDefineFilter::CONDITION_FIELD_NAME_PINYINEN,Condition::CONDITION_NOTIN,$enRange);
	            $americanFilter->where(AmericanDefineFilter::CONDITION_FIELD_NAME_ID, Condition::CONDITION_OR,array(
	                new Condition(AmericanDefineFilter::CONDITION_FIELD_NAME_PINYINEN,Condition::CONDITION_NOTIN,$enRange),
	                new Condition(AmericanDefineFilter::CONDITION_FIELD_NAME_PINYINCH,Condition::CONDITION_NOTIN,$enRange)
	            ));
	        }else{
	           // $americanFilter->where(AmericanDefineFilter::CONDITION_FIELD_NAME_PINYINEN,Condition::CONDITION_EQUAL,$condition['letter']);
	            $americanFilter->where(AmericanDefineFilter::CONDITION_FIELD_NAME_ID, Condition::CONDITION_OR,array(
	                new Condition(AmericanDefineFilter::CONDITION_FIELD_NAME_PINYINEN,Condition::CONDITION_EQUAL,$condition['letter']),
	                new Condition(AmericanDefineFilter::CONDITION_FIELD_NAME_PINYINCH,Condition::CONDITION_EQUAL,$condition['letter'])
	            ));
	        }
	    }
	    $americanFilter->where(AmericanDefineFilter::CONDITION_FIELD_NAME_STATUS,Condition::CONDITION_EQUAL,\haibao\cms\model\data\americandrama\AmericanDefine::STATUS_ENABLE);
	    $americanFilter->order(AmericanDefineFilter::CONDITION_FIELD_NAME_RELEASEDATE,false);
	    if($isWap){
	       $americanFilter->setPager(new Pager(self::WAP_PAGE_SIZE,$condition['page']));
	    }else{
	       $americanFilter->setPager(new Pager(self::PC_PAGE_SIZE,$condition['page']));
	    }
	    $pager = $americanFilter->getPager();
	    $americanList = \haibao\cms\business\americandrama\AmericanDefine::getAmericanByFilter($americanFilter,false);
	    
	    $meijuType = \haibao\cms\business\americandrama\AmericanDefine::$meiju_jmtype_arr;
	    $meijuStation = \haibao\cms\business\americandrama\AmericanDefine::$meiju_dt_arr;
	    $meijuDate = \haibao\cms\business\americandrama\AmericanDefine::$meiju_date_arr;
	    $designTagInfoList = $designTagIdArr = $designImageIdArr = array();
	    if($americanList){
	        foreach($americanList as $american){
	            foreach($american->AmericanCategory as $key=>$val){
	                if(isset($meijuType[$val->CategoryId])){
	                    $american->AmericanCategory[$key]->CategoryName = $meijuType[$val->CategoryId];
	                }
	            }
	            if(isset($american->AvatarUrl)){
	                if($isWap){
	                    $american->AvatarUrl = self::getImageLink($american->AvatarUrl,105,150);
	                }else{
	                    if(!$american->AvatarUrl){
	                        $american->AvatarUrl = \haibao\classlibrary\Config::getConfig(\haibao\classlibrary\Config::CLASSLIBRARY_CONFIG_CDN_DOMAIN).'/images/UsdramaFigure.jpg';
	                    }else{
	                        $american->AvatarUrl = self::getImageLink($american->AvatarUrl,205,300);
	                    }
	                    
	                }
	            }
	            if($isWap){
	                $american->AmericanUrl = \haibao\classlibrary\Config::getConfig(\haibao\classlibrary\Config::CLASSLIBRARY_CONFIG_HOST_WAP).'/meiju/'.$american->Id.'/';
	            }else{
    	            $american->AmericanUrl = \haibao\classlibrary\Config::getConfig(\haibao\classlibrary\Config::CLASSLIBRARY_CONFIG_TV_HOST).'meiju/'.$american->Id.'/';
	            }
	        }
	    }
	    return array($americanList,$pager);
	    //return $designerList;
	}
	
}
